import com.maxmind.geoip.*;

public class GeoInfo {
  public String url;
  public Point2f p;
	private com.maxmind.geoip.Location loc;

	GeoInfo(String ip) {
          url = ip; // Please don't bash me for such an assignment
	  initGeoInfo();
	}

	private void initGeoInfo() {
		LookupService ls;

		try {
			ls = new LookupService(dataPath("GeoLiteCity.dat"), 
					       LookupService.GEOIP_MEMORY_CACHE);
			loc = ls.getLocation(url);
                        p = map.locationPoint(new com.modestmaps.geo.Location(loc.latitude, loc.longitude));
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}

	public float getLat () {
		return loc.latitude;
	}

	public float getLon () {
		return loc.longitude;
	}

    public String getURL() {
      return url; 
    }  
}

